<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>self</title>
    <script src="../../前端开发/vue.js"></script>
</head>
<body>
    <style>
        .Odiv1 {width: 80px; height: 80px; background: #aaa; margin: 5px;}
        .Odiv1 {width: 50px; height: 50px; background: #ccc;}
    </style>
    <div id="app">
        <div class="Odiv1" v-on:click.self="doParent">a
            <div class="Odiv2" v-on:click.self="doThis">b</div>

        </div>
        <div class="Odiv1" v-on:click="doParent">c
            <div class="Odiv2" v-on:click.self="doThis">d</div>

        </div>

    </div>
    <script>
                var vm = new Vue({
            el: '#app',
            methods: {
                doParent () {
                    console.log('我是父元素单击事件')
                },
                doThis () {
                    console.log('我是被单击元素事件')
                }

            }
        })
    </script>
    
</body>
</html>